﻿package ygg.encoding.swf.tag
{
	public class TagType
	{
		public static const END:uint = 0x0;             //0
		public static const SHOW_FRAME:uint = 0x1;              //1
		public static const DEFINE_SHAPE:uint = 0x2;            //2
		public static const FREE_CHARACTER:uint = 0x3;          //3
		public static const PLACE_OBJECT:uint = 0x4;            //4
		public static const REMOVE_OBJECT:uint = 0x5;           //5
		public static const DEFINE_BITS:uint = 0x6;             //6
		public static const DEFINE_BUTTON:uint = 0x7;           //7
		public static const JPEGTABLES:uint = 0x8;              //8
		public static const SET_BACKGROUND_COLOR:uint = 0x9;            //9
		public static const DEFINE_FONT:uint = 0xa;             //10
		public static const DEFINE_TEXT:uint = 0xb;             //11
		public static const DO_ACTION:uint = 0xc;               //12
		public static const DEFINE_FONT_INFO:uint = 0xd;                //13
		public static const DEFINE_SOUND:uint = 0xe;            //14
		public static const START_SOUND:uint = 0xf;             //15
		public static const STOP_SOUND:uint = 0x10;             //16
		public static const DEFINE_BUTTON_SOUND:uint = 0x11;            //17
		public static const SOUND_STREAM_HEAD:uint = 0x12;              //18
		public static const SOUND_STREAM_BLOCK:uint = 0x13;             //19
		public static const DEFINE_BITS_LOSSLESS:uint = 0x14;           //20
		public static const DEFINE_BITS_JPEG_2:uint = 0x15;             //21
		public static const DEFINE_SHAPE_2:uint = 0x16;         //22
		public static const DEFINE_BUTTON_CXFORM:uint = 0x17;           //23
		public static const PROTECT:uint = 0x18;                //24
		public static const PATHS_ARE_POST_SCRIPT:uint = 0x19;          //25
		public static const PLACE_OBJECT_2:uint = 0x1a;         //26
		
		public static const REMOVE_OBJECT_2:uint = 0x1c;                //28
		public static const SYNC_FRAME:uint = 0x1d;             //29
		
		public static const FREE_ALL:uint = 0x1f;               //31
		public static const DEFINE_SHAPE_3:uint = 0x20;         //32
		public static const DEFINE_TEXT_2:uint = 0x21;          //33
		public static const DEFINE_BUTTON_2:uint = 0x22;                //34
		public static const DEFINE_BITS_JPEG_3:uint = 0x23;             //35
		public static const DEFINE_BITS_LOSSLESS_2:uint = 0x24;         //36
		public static const DEFINE_EDIT_TEXT:uint = 0x25;               //37
		public static const DEFINE_VIDEO:uint = 0x26;           //38
		public static const DEFINE_SPRITE:uint = 0x27;          //39
		public static const NAME_CHARACTER:uint = 0x28;         //40
		public static const PRODUCT_INFO:uint = 0x29;           //41
		public static const DEFINE_TEXT_FORMAT:uint = 0x2a;             //42
		public static const FRAME_LABEL:uint = 0x2b;            //43
		public static const DEFINE_BEHAVIOR:uint = 0x2c;                //44
		public static const SOUND_STREAM_HEAD_2:uint = 0x2d;            //45
		public static const DEFINE_MORPH_SHAPE:uint = 0x2e;             //46
		public static const FRAME_TAG:uint = 0x2f;              //47
		public static const DEFINE_FONT_2:uint = 0x30;          //48
		public static const GEN_COMMAND:uint = 0x31;            //49
		public static const DEFINE_COMMAND_OBJ:uint = 0x32;             //50
		public static const CHARACTER_SET:uint = 0x33;          //51
		public static const FONT_REF:uint = 0x34;               //52
		public static const DEFINE_FUNCTION:uint = 0x35;                //53
		public static const PLACE_FUNCTION:uint = 0x36;         //54
		public static const GEN_TAG_OBJECT:uint = 0x37;         //55
		public static const EXPORT_ASSETS:uint = 0x38;          //56
		public static const IMPORT_ASSETS:uint = 0x39;          //57
		public static const ENABLE_DEBUGGER:uint = 0x3a;                //58
		public static const DO_INIT_ACTION:uint = 0x3b;         //59
		public static const DEFINE_VIDEO_STREAM:uint = 0x3c;            //60
		public static const VIDEO_FRAME:uint = 0x3d;            //61
		public static const DEFINE_FONT_INFO_2:uint = 0x3e;             //62
		public static const DEBUG_ID:uint = 0x3f;               //63
		public static const ENABLE_DEBUGGER_2:uint = 0x40;              //64
		public static const SCRIPT_LIMITS:uint = 0x41;          //65
		public static const SET_TAB_INDEX:uint = 0x42;          //66

		public static const FILE_ATTRIBUTES:uint = 0x45;                //69
		public static const PLACE_OBJECT_3:uint = 0x46;         //70
		public static const IMPORT_ASSETS_2:uint = 0x47;                //71
		public static const DO_ABC:uint = 0x48;         //72// embedded .abc (AVM+) bytecode
		public static const DEFINE_FONT_ALIGN_ZONES:uint = 0x49;                //73
		public static const CSMTEXT_SETTINGS:uint = 0x4a;               //74
		public static const DEFINE_FONT_3:uint = 0x4b;          //75
		public static const SYMBOL_CLASS:uint = 0x4c;           //76
		public static const METADATA:uint = 0x4d;               //77
		public static const DEFINE_SCALING_GRID:uint = 0x4e;            //78
		
		public static const DO_ABC_2:uint = 0x52;               //82 // revised ABC version with a name
		public static const DEFINE_SHAPE_4:uint = 0x53;         //83
		public static const DEFINE_MORPH_SHAPE_2:uint = 0x54;           //84
		
		public static const DEFINE_SCENE_AND_FRAME_LABEL_DATA:uint = 0x56; //86
		public static const DEFINE_BINARY_DATA:uint = 0x57;             //87
		public static const DEFINE_FONT_NAME:uint = 0x58;               //88
		public static const START_SOUND_2:uint = 0x59;          //89
		public static const DEFINE_BITS_JPEG_4:uint = 0x5a;             //90
		public static const DEFINE_FONT_4:uint = 0x5b;          //91

		
		public static var tagNames:Array = [
			"End",					// 00
			"ShowFrame",			// 01
			"DefineShape",			// 02
			"FreeCharacter",		// 03 not in spec
			"PlaceObject",			// 04
			"RemoveObject",			// 05
			"DefineBits",			// 06
			"DefineButton",			// 07
			"JPEGTables",			// 08
			"SetBackgroundColor",	// 09
			"DefineFont",			// 10
			"DefineText",			// 11
			"DoAction",				// 12
			"DefineFontInfo",		// 13
			"DefineSound",			// 14
			"StartSound",			// 15
			"StopSound",			// 16 not in spec
			"DefineButtonSound",	// 17
			"SoundStreamHead",		// 18
			"SoundStreamBlock",		// 19
			"DefineBitsLossless",	// 20
			"DefineBitsJPEG2",		// 21
			"DefineShape2",			// 22
			"DefineButtonCxform",	// 23
			"Protect",				// 24
			"PathsArePostScript",	// 25 not in spec
			"PlaceObject2",			// 26
			
			"27 (invalid)",			// 27
			
			"RemoveObject2",		// 28
			"SyncFrame",			// 29 not in spec
			
			"30 (invalid)",			// 30
			
			"FreeAll",				// 31 not in spec
			"DefineShape3",			// 32
			"DefineText2",			// 33
			"DefineButton2",		// 34
			"DefineBitsJPEG3",		// 35
			"DefineBitsLossless2",	// 36
			"DefineEditText",		// 37
			"DefineVideo",			// 38 not in spec
			"DefineSprite",			// 39
			"NameCharacter",		// 40 not in spec
			"ProductInfo",			// 41 not in spec
			"DefineTextFormat",		// 42 not in spec
			"FrameLabel",			// 43
			"DefineBehavior",		// 44 not in spec
			"SoundStreamHead2",		// 45
			"DefineMorphShape",		// 46
			"FrameTag",				// 47 not in spec
			"DefineFont2",			// 48
			"GenCommand",			// 49 not in spec
			"DefineCommandObj",		// 50 not in spec
			"CharacterSet",			// 51 not in spec
			"FontRef",				// 52 not in spec
			"DefineFunction",		// 53 not in spec
			"PlaceFunction",		// 54 not in spec
			"GenTagObject",			// 55 not in spec
			"ExportAssets",			// 56
			"ImportAssets",			// 57
			"EnableDebugger",		// 58
			"DoInitAction",			// 59
			"DefineVideoStream",	// 60
			"VideoFrame",			// 61
			"DefineFontInfo2",		// 62
			"DebugID", 				// 63 not in spec
			"EnableDebugger2", 		// 64
			"ScriptLimits", 		// 65
			"SetTabIndex", 			// 66
			"67 (invalid)", 		// 67 not in spec
			"68 (invalid)", 		// 68 not in spec
			"FileAttributes", 		// 69
			"PlaceObject3", 		// 70
			"ImportAssets2", 		// 71
			"DoABC", 				// 72 not in spec
			"DefineFontAlignZones",	// 73 DefineFontAlignZones
			"CSMTextSettings",		// 74 CSMTextSettings
			"DefineFont3",			// 75 DefineFont3
			"SymbolClass",			// 76
			"Metadata",         	// 77 Metadata
			"DefineScalingGrid",    // 78
			
			'79 (invalid)',
			'80 (invalid)',
			'81 (invalid)',
			
			"DoABC2",               // 82
			"DefineShape4",         // 83
			"DefineMorphShape2",    // 84
			
			'85 (invalid)',
			
			"DefineSceneAndFrameLabelData",         // 86
			"DefineBinaryData",     // 87
			"DefineFontName",       // 88
			"StartSound2",          // 89
			"DefineBitsJPEG4",      // 90
			"DefineFont4"           // 91
		]
		
		public static function getName(type:int):String
		{
			if ( tagNames[type] != null) return tagNames[type];
			else return type.toString() + ' unknown';
		
		}
		
	}
}